<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/include/taglibs.jsp"%>
<html>
<head>
<style type="text/css">
body { /*background-image: url(../images/mainframe-bg.jpg);
	background-repeat: repeat-x;*/
	margin: 0px auto;
	padding: 0px;
	position: relative;
	text-align: center;
}
</style>

<script language="javascript">
<!--
function senfe(o,a,b,c,d){
var t=document.getElementById(o).getElementsByTagName("tr");
for(var i=0;i<t.length;i++){
t[i].style.backgroundColor=(t[i].sectionRowIndex%2==0)?a:b;
t[i].onclick=function(){
if(this.x!="1"){
this.x="1";//本来打算直接用背景色判断，FF获取到的背景是RGB值，不好判断
this.style.backgroundColor=d;
}else{
this.x="0";
this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
}
}
$(t[i]).mouseover(function(){
if(this.x!="1")this.style.backgroundColor=c;
});
$(t[i]).mouseout(function(){
if(this.x!="1")this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
});
}
}
$(document).ready(function (){
	//senfe("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景");
	senfe("t_robotlog","#e5f1f4","#f8fbfc","#ecfbd4","#bce774");
});
--></script>

<script type="text/javascript">
function doDelete(id){
	var prompt = "确实要删除此告警吗？";
	if(window.confirm(prompt)){
		document.location.href = "<%=request.getContextPath()%>/alert.robotlognavi.do?action=delete&id="+id;
	}
}

function doSeleDelete(){  
	var prompt = "确实要删除选择告警吗？";	
	if(window.confirm(prompt)){
		var url_str = "<%=request.getContextPath()%>/alert.robotlognavi.do?action=delete&rnd"+Math.random();
		frmList.action = url_str;		
		frmList.submit();	
	}
}

function doExportExcelfirm(){  
	var prompt = "确实要导出当前告警吗？";	
	if(window.confirm(prompt)){
		var url_str = "<%=request.getContextPath()%>/alert.robotLogCurrentExcel.do?rnd"+Math.random();
		frmList.action = url_str;		
		frmList.submit();	
	}
}

function doSeleConfirm(){  
	var prompt = "确实要确认选择告警吗？";	
	if(window.confirm(prompt)){
		var url_str = "<%=request.getContextPath()%>/alert.robotlognavi.do?action=confirm&rnd"+Math.random();
		frmList.action = url_str;		
		frmList.submit();	
	}
}

function search(){		
	var url_str = "<%=request.getContextPath()%>/alert.robotlogquery.do?rnd"+Math.random();
	frmList.action = url_str;		
	frmList.submit();	
}

</script>

<link rel="stylesheet"
	href="<%=request.getContextPath() %>/pages/alert/thickbox.css"
	type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath() %>/pages/alert/thickbox.js"></script>


</head>

<div>
<div style="text-align: left; color: red"><html:errors /></div>

<form id="frmList" action="alert.robotlogquery.do" method="post">
<table width="100%" border="0" cellpadding="3" cellspacing="0"
	class="sanxuan" style="background-repeat: repeat;">
	<tbody>
		<tr>
			<td height="31" width="900px"
				style="font-size: 14px; color: white; text-align: center">&nbsp;告警查询</td>
		</tr>
		<tr>
			<td>
			<table border="0" width="95%" align="center">
				<tr align="left">
					<td><strong>探针名称 :<input name="robotName" id="robotName"
						type="text" style="width: 125px;" value="${robotName}"> <strong>告警状态 :</strong>
					<select name="confirmStatus" id="confirmStatus" style="width: 125px">
						<option value="">请选择...</option>
						<option value="1">已确认</option>
						<option value="0">未确认</option>
					</select>					
					<strong>告警描述:</strong> <input id ="qoememo" name="qoememo" style="width: 175px;" value="${qoememo}" /> 
					<strong>发生时间:</strong> <input id="startTime" name="startTime"
						type="text" style="width: 125px;" value="${startTime}">
					<a href id="startDateTrigger"><img src="images/calendar.gif"
						border="0"></a> &nbsp;--&nbsp;<input id="endTime" name="endTime"
						type="text" style="width: 125px;" value="${endTime}"><a
						href id="endDateTrigger"><img src="images/calendar.gif"
						border="0"></a></td>
					<td align="left"><img
						src="<%=request.getContextPath() %>/images/table/chaxun.gif"
						width="90" height="30" style="cursor: hand;"
						onclick="javascript:search();" /></td>
				</tr>
			</table>
			</td>
		</tr>
	</tbody>
</table>
<div class="guanli" style="float: right;"><br />
<c:if test="${empty param.flag}">
	<input name="exportExcel" type="button" class="button" value="导出Excel"
		onclick="javascript:doExportExcelfirm();" />
	<input name="add" type="button" class="button" value="批量确认"
		onclick="javascript:doSeleConfirm();" />
	<input type="button" name="delete" class="button" value="批量删除"
		onclick="javascript:doSeleDelete();" />
</c:if></div>
<table width="100%" cellpadding="4" class="liebiao" id="t_robotlog"
	align="center">
	<thead>
		<tr>
			<td width="23" align="center"><c:if test="${empty param.flag}">
				<input id="all" name="all" type="checkbox"
					onclick="list_select_all();" />
			</c:if></td>
			<td>所属区局</td>
			<td>发生时间</td>
			<td>探针名称</td>			
			<td>告警状态</td>
			<td>告警视频</td>
			<td>前网络包</td>
			<td>网络包</td>
			<td>告警描述</td>
			<td>红外指令</td>
			<td>&nbsp;</td>
		</tr>
	</thead>
	<tbody>
		<c:forEach var='bean' items="${RA_PAGER_ITEMS}" varStatus="vs">
			<tr>
				<td class="list-value"><input id="id" name="id" type="checkbox"
					value="${bean.robotlog.idRobotLog}"
					onClick="list_check_selection()"></td>				
				<td class="list-value">${bean.robotManage.regionManage.regionName}</td>
				<td class="list-value">${bean.robotlog.logTimeStr}</td>
				<td class="list-value">${bean.robotManage.name}</td>				
				<td class="list-value" style="text-align: center;">
					<c:if test="${bean.robotlog.confirm==0}">
						<font color="#CE0101">未确认</font>
					</c:if>
					<c:if test="${bean.robotlog.confirm==1}">
						<font color="#8FC963">已确认</font>
					</c:if></td>
				<td class="list-value"><a
					href="alert.RobotSyncFileDownloadAction.do?id=${bean.robotlog.idRobotLog}&type=videoFile&KeepThis=true&TB_iframe=true&height=285&width=418"
					title="下载页面"
					class="thickbox"> 
					
					  下载播放
					<!-- 
					<c:if
					test="${null!=bean.robotlog.videoFile && !empty bean.robotlog.videoFile}">					
					${fn:substring(bean.robotlog.videoFile,12,fn:length(bean.robotlog.videoFile))}				
				</c:if>  --></a></td>
				<td class="list-value"><a
					href="alert.RobotSyncFileDownloadAction.do?id=${bean.robotlog.idRobotLog}&type=prePcapFile&KeepThis=true&TB_iframe=true&height=285&width=418"
					title="下载页面"
					class="thickbox"> 
					下载
					<!-- 
					<c:if
					test="${ null!=bean.robotlog.prePcapFile &&!empty bean.robotlog.prePcapFile}">
					${fn:substring(bean.robotlog.prePcapFile,12,fn:length(bean.robotlog.prePcapFile))}				
				</c:if> --> </a></td>
				<td class="list-value"><a
					href="alert.RobotSyncFileDownloadAction.do?id=${bean.robotlog.idRobotLog}&type=pcapFile&KeepThis=true&TB_iframe=true&height=285&width=418"
					title="下载页面"
					class="thickbox">					
					下载
					<!-- 
					<c:if test="${bean.robotlog.pcapFile !=null &&!empty bean.robotlog.pcapFile}">
					    ${fn:substring(bean.robotlog.pcapFile,12,fn:length(bean.robotlog.pcapFile))}
					</c:if>-->				
					</a></td>
				<td class="list-value">
				<!-- 
				<c:choose>
				   <c:when test="${bean.robotlog.qoeMomo=='Static/Black Frame'}">
				   		静止或黑屏
				   </c:when>
				   
				   <c:when test="${bean.robotlog.qoeMomo=='Static/Black Frame'}">
				   		静止或黑屏
				   </c:when>
				   <c:otherwise>				   
				       ${bean.robotlog.qoeMomo}</c:otherwise>				   
				</c:choose>		
				

				 -->
				${bean.robotlog.qoeMomo}		
				</td>
				<td class="list-value">${bean.robotlog.irMomo}</td>
				<td class="list-value" style="width: 185px;"><a class="modify"
					href="alert.robotlognavi.do?action=confirm&id=${bean.robotlog.idRobotLog}">确认</a>
				<a class="delete"
					href="javascript:doDelete(${bean.robotlog.idRobotLog})">删除</a> <a
					class="setting"
					href="alert.robotlogdetailquery.do?id=${bean.robotlog.idRobotLog}">告警分析</a>
				</td>
			</tr>
		</c:forEach>
	</tbody>
	<tfoot>
	</tfoot>
</table>
<br />
<div class="pagenav"><jsp:include page="/include/pager.jsp"
	flush="true" /></div>
</form>
</div>
<script type="text/javascript">
	var st = new SortableTable( document.getElementById("t_robotlog"), ["None", "String","String", "String","String","String","String" ,"None"],'#E4EEF7','white','#FF9900');
	
Zapatec.Calendar.setup({
        firstDay:1,
        showOthers:true,
        range:[1980.01, 2010.12],
        inputField:"startTime",
        button:"startDateTrigger",
        ifFormat:"%Y-%m-%d %H:%M",
        showsTime: true
        });
Zapatec.Calendar.setup({
        firstDay:1,
        showOthers:true,
        range:[1980.01, 2010.12],
        inputField:"endTime",
        button:"endDateTrigger",
        ifFormat:"%Y-%m-%d %H:%M",
        showsTime: true
        });

selectOption('confirmStatus','${confirmStatus}');
        
 //*定时更新页面
/*window.setInterval("toRefresh()", 5*60*1000);  */     
</script>

</html>